{template Public:Admin:header}


                <h3>退款详细</h3>
                
              {if $manage['process']==2}
                    <div class="alert alert-warning fade in">
                        <button data-dismiss="alert" class="close">
                            ×
                        </button>
                        <i class="fa-fw fa fa-info-circle"></i>
                            <strong>提示</strong> 服务商不同意退款,客服已介入.
                    </div>
              {/if}
              

				<table class="table table-striped table-bordered table-hover">
                <thead>
                    <tr>
                        <th>
                        	 ID
                        </th>
                        <th>
                        	 标题
                        </th>
                        <th>
                            交易金额
                        </th>
                         <th>
                            退款金额
                        </th>
                        <th>
                          申请时间
                        </th>
                        <th>
                        处理状态
                        </th>
                        <th>
                        操作
                        </th>
                    </tr>
                </thead>
                <tbody>
  
                <tr>
                
                    <td>
                    {echo $manage['rid']}
                    </td>
                    
                    <td>
                        <a href="/task/{echo $manage['id']}" target="_blank">{echo $manage['subject']}</a>
                    </td>

                    <td>
                        {echo $manage['money']/100} 元
                    </td>
                     <td>
                        {echo $manage['refund']/100} 元
                    </td>
                      <td>
                      {echo FormatDate("Y/m/d",$manage['dateline'])}
                    </td>
                     <td>
                    {if $manage['process']==1}申请中{elseif $manage['process']==2}服务商不同意退款{elseif $manage['process']==3}服务商已同意退款{/if}
                    </td>
                     <td>
                     {if $manage['seller_uid']==$uid && $manage['process']==1}<a class="btn btn-palegreen btn-sm" href="javascript:void(0);" onclick="AgreeRefund({echo $manage['rid']},{echo $manage['refund']/100});">同意</a>  <a class="btn btn-darkorange btn-sm" href="javascript:void(0);" onclick="DisagreeRefund({echo $manage['rid']},{echo $manage['refund']/100});">不同意</a>{/if}
                     </td>
                </tr>
                      
                    
                </tbody>
            </table>
            <p></p>
            <div class="row">
            	 
                        <div class="col-lg-4 col-sm-6 col-xs-12">
                            <div class="databox databox-graded">
                                <div class="databox-left">
                                    {echo GetAvatarSimple($manage['seller_uid'],48)}
                                </div>
                                <div class="databox-left">
                                    <div class="databox-text"><strong>卖家</strong></div>
                                    <div class="databox-text darkgray">{echo $manage['seller_username']}</div>
                                </div>
                                 <div class="databox-left">
                                <a class="btn btn-darkorange btn-sm" href="javascript:void(0);" onclick="dialogmessage('{echo $manage['seller_username']}')">站内信</a>
                                </div>
                            </div>
                        </div>
                        
                       <div class="col-lg-4 col-sm-6 col-xs-12">
                            <div class="databox databox-graded">
                                <div class="databox-left">
                                    {echo GetAvatarSimple($manage['service_uid'],48)}
                                </div>
                                <div class="databox-left">
                                    <div class="databox-text"><strong>客服</strong></div>
                                    <div class="databox-text darkgray">{echo $manage['service_username']}</div>
                                </div>
                                 <div class="databox-left">
                                <a class="btn btn-darkorange btn-sm" href="javascript:void(0);" onclick="dialogmessage('{echo $manage['service_username']}')">站内信</a>
                                </div>
                            </div>
                        </div>
                        
                          <div class="col-lg-4 col-sm-6 col-xs-12">
                            <div class="databox databox-graded">
                                <div class="databox-left">
                                    {echo GetAvatarSimple($manage['buyer_uid'],48)}
                                </div>
                                <div class="databox-left">
                                    <div class="databox-text"><strong>买家</strong></div>
                                    <div class="databox-text darkgray">{echo $manage['buyer_username']}</div>
                                </div>
                                 <div class="databox-left">
                                <a class="btn btn-darkorange btn-sm" href="javascript:void(0);" onclick="dialogmessage('{echo $manage['buyer_username']}')">站内信</a>
                                </div>
                            </div>
                        </div>
           
                    </div>
                            
                <hr />
                
                {if !empty($list)}
        		<ul class="timeline" style="width:700px; left:-120px;">
                        <li class="timeline-node">
                            <a class="btn btn-palegreen">开始</a>
                        </li>
                        
                        {foreach $list $value}
                        <li class="timeline-inverted">
                            <div class="timeline-datetime">
                                <span class="timeline-time">
                                   {echo FormatDate("H:i",$value['dateline'])}
                                </span><span class="timeline-date">{echo FormatDate("Y/m/d",$value['dateline'])}</span>
                            </div>
                            <div class="timeline-badge darkorange">
                                {echo GetAvatarSimple($value['uid'],48,'badge-picture')}
                            </div>
                            <div class="timeline-panel bordered-right-3">
                                <div class="timeline-header bordered-bottom bordered-blue">
                                    <span class="timeline-title">
                                        {echo $value['username']}
                                    </span>
                                    <p class="timeline-datetime">
                                        <small class="text-muted">
                                            <i class="glyphicon glyphicon-time">
                                            </i>
                                            <span class="timeline-date">Today</span>
                                            -
                                            <span class="timeline-time">3:10</span>
                                        </small>
                                    </p>
                                </div>
                                <div class="timeline-body">
                                    <p>{echo $value['content']}</p>
                                </div>
                            </div>
                        </li>
       					  {/foreach}
                   
                    
                    </ul>  
                    
                     {if $page}
                    <p>
                    <div class="dataTables_paginate paging_bootstrap text-right"><ul class="pagination">{echo $page}</ul></div>
                    </p>
                    {/if} 
                    {/if}
            
            
         
            <div class="row">
               <hr />
            <br />
            	
               
                   <div class="col-lg-2"><h4>客服操作</h4></div>
                    <div class="col-lg-3">
                      <input name="money" type="text" id="Money" class="form-control" placeholder="退款金额" value=""/>
                    </div>
                    <div class="col-lg-2">
                      <input class="btn btn-success" name="Submit" type="submit" onclick="AgreeRefund({echo $manage['rid']})" value="提交退款" />
                      <input type="hidden" name="rid" value="{echo $manage['rid']}" />
                    </div>
                
               
            </div>
            
            
<script>
function AgreeRefund(rid){
	   var money=parseInt($('#Money').val()) ? parseInt($('#Money').val()) : 0;  
	   bootbox.confirm({  
		buttons: {  
			confirm: {  
				label: '确认',  
				className: 'btn-success'  
			},  
			cancel: {  
				label: '取消',  
				className: 'btn-default'  
			}  
		},  
		message:  '是否同意退款'+money+'元？',  
		callback: function(result) {  
			if(result) {  
				 bootbox.hideAll();
				 $.post('{echo U("/admin/refund/agree")}',{rid:rid,money:money}, function(json) {
					
						$('.bootbox').PhpappProgress({json:json});

						return true;
					
				  }, 'json');

				 bootbox.dialog({
					 message: '<div class="progress progress-striped active"><div style="width: 1%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="20" role="progressbar" class="progress-bar progress-bar-info"><span>0%</span></div></div>',
					 title: '<i class="icon fa fa-retweet"></i> 提交中',
					 closeButton: false
				 }).PhpappProgress({time:3000});
			 
				  return false; 
				
			} 
		},  
		title: "退款操作",  
		});
		
}
</script>

{template Public:Admin:footer}